-- GENERATED SPELL FOR [Red Dragonspawn] --


function spell0_1045(pUnit, Event) --@Hamstring,n/a--
pUnit:FullCastSpellOnTarget(9080,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1045', 10285, 1)
end

function spell1_1045(pUnit, Event) --@Strike,n/a--
pUnit:FullCastSpellOnTarget(15580,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1045', 599, 1)
end

function Sorts_1045(pUnit, Event)
local choix_sorts_1045 = math.random(0, 1)
if choix_sorts_1045 == 0 then
pUnit:RegisterEvent('spell0_1045', 1, 1)
end
if choix_sorts_1045 == 1 then
pUnit:RegisterEvent('spell1_1045', 1, 1)
end
end

function mob1045_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1045', math.random(1500, 3000), 1)
end

function mob1045_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1045_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1045_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1045, 1, 'mob1045_Action')
RegisterUnitEvent(1045, 2, 'mob1045_Leave')
RegisterUnitEvent(1045, 3, 'mob1045_Kill')
RegisterUnitEvent(1045, 4, 'mob1045_Die')
